<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="com.fg.model.ProductVO, java.util.Map, java.util.List" %>

<%
String imagePath = "https://freegive-uploaded-files.s3.amazonaws.com/images/";
Map resultMap = (Map)request.getAttribute("resultMap");
List<ProductVO> product_list = (List)resultMap.get("product_list");
%>	
<%if(product_list.size() > 0){
	for(ProductVO product : product_list){%>
		<div class="product_container" onclick="window.location='loadProduct.action?product_seq=<%=product.getProduct_seq()%>';">
			<div class="product_top">
				<%if(product.getImage_list() != null){ %>
					<img src="<%=imagePath+product.getImage_list().get(0).getImage_path()%>" style="width: 94%; height: 100%">
				<%}else{ %>
					<img src="image/no_photo.jpg" style="width: 94%; height: 100%">
				<%}%>
				<div class="product_status">
					<%if(product.getRegist_type().equals("선물")){ %>
						<img src="image/s_gift.png" style="width: 80px; height: 60px">
					<%}else if(product.getRegist_type().equals("포인트")){ %>
						<img src="image/s_point.png" style="width: 80px; height: 60px">
					<%} %>
				</div>
			</div>
			<div class="product_bottom">
				<div class="product_name">
					<%=product.getP_name() %>
				</div>
				<div class="product_point">
					<%if(product.getRegist_type().equals("선물")){ %>
						선물
					<%}else if(product.getRegist_type().equals("포인트")){ %>
						P&nbsp;<%=product.getP_point() %>
					<%} %>
				</div>
			</div>
		</div>
	<%}
}%>
